#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include<stdint.h>
#include <iconv.h>
#include <ctype.h>
#include <pthread.h>

#include<math.h>



void send_data(void *data,int len);
void send_idata(int *data,int len);


void main() 
{
    int intdata[24];
    int intdata2[24];
    int int1[2][24];
    int int2[2][24];

    for(int i=0;i<24;i++)
    {
        intdata[i] = i;
        int2[0][i] = i;
        int2[1][i] = i+24;
        intdata2[i] = i+24;
    }
    memcpy(int1,intdata,sizeof(intdata));
    memcpy(int1[1],intdata2,sizeof(intdata));//不能截断，即memcpy(intdata[2],"intdata",sizeof("intdata"))

    send_data(int1,sizeof(int1)/sizeof(int));
    //send_idata(int1,sizeof(int1)/sizeof(int));
    //send_idata(int2,sizeof(int2)/sizeof(int));
}
void send_idata(int *data,int len)
{
    printf("len = %d\n",len);
    while(len--)
    {
        printf("data = %d\n",*data++);
    }
}
void send_data(void *data,int len)
{
    printf("len = %d\n",len);
    int *ptr_int = (int *) data;//若传输类型为uint16_t,则uint16_t *ptr_int = (uint16_t *) data;
    while(len--)
    {
            printf("data = %d\n",*ptr_int++);
    }
}